package classes.multithread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author : DuJiabao
 * @Date : 2021/2/9 9:43
 * @Project : java_learning
 * @File : null.java
 * @Desc :
 */
public class CachedThreadPoolTest {
  public static void main(String[] args) {
    // 通过执行器，实现线程的管理
    ExecutorService executorService = Executors.newCachedThreadPool();
    for (int i = 0; i < 5; i++) {
      executorService.execute(new RunnableImpl());
    }
    executorService.shutdown();
  }
}
